package cn.jorian.framework.controller;

import cn.jorian.framework.bean.SongBean;
import cn.jorian.framework.service.ISongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/thymeleaf")
public class ThymeLeafController {

    @Autowired
    private ISongService iSongService;

    @RequestMapping("/findName")
    public String findByName(Model model) {
        List<SongBean> beanList = iSongService.findByName("妙手空空");
        model.addAttribute("beanList", beanList);
        //模板名称
        return "thymeleaf";
    }
}
